# Makefile
# Qui fonctionne ^^

PRG = aurora

# Fichiers dans l'ordre
ML =code.c facto.ml arbre_lexical.ml popup.ml function.ml settings.ml source_view.ml compil.ml depots.ml searchReplace.ml project.ml notebook.ml debug.ml tree_view.ml interface_option.ml graph.ml gestionModule.ml aurora.ml 
MLI = 

CMO=${ML:.ml=.cmo}
CMX=${ML:.ml=.cmx}
CMI=${ML:.mli=.cmi}

OCAMLFLAGS = -I +lablgtk2
OCAMLLD = str.cmxa unix.cmxa lablgtk.cmxa lablgtksourceview2.cmxa -ccopt -L.
OCAMLOPT = ocamlopt.opt
OCAMLC = ocamlc.opt
OCAMLDEP = ocamldep

${PRG}: libgtksourceview-2.0.so ${CMX}
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -o $@ ${CMX}	
	make clean

.SUFFIXES: .ml .mli .cmo .cmx .cmi

.ml.cmx: 
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -c $<

.ml.cmo: 
	${OCAMLC} -c $<

.mli.cmi: 
	${OCAMLC} -c $<

libgtksourceview-2.0.so:
	-ln -s /usr/lib64/libgtksourceview-2.0.so.0 libgtksourceview-2.0.so

clean:
	rm -f *~ *.o *.cm? *mli

fullclean: clean
	rm -f .depend ${PRG}

depend: .depend
.depend: ${ML} ${MLI}
	rm -f .depend
	${OCAMLDEP} ${ML} ${MLI} > .depend
			 
include .depend
